/**
 * 
 */
package com.usc.nearbyus;

import java.util.Calendar;
import java.util.List;
import java.util.Map;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.wifi.ScanResult;
import android.net.wifi.WifiManager;
import android.text.InputFilter.LengthFilter;
import android.util.Log;
import android.widget.Toast;

/**
 * @author pranav
 *
 */
public class WiFiScanReceiver extends BroadcastReceiver {

	Nearbyus nearbyus;
	private String TAG = "WiFiScanReceiver";	
	private WifiLoggingTest mWifiLoggingTest;
	private ReadingsDbAdapter mDbAdapter;
	private GPSLoggerService mGPSLoggerTest;
	private List<ScanResult> results;


	/**
	 * @param nearbyus
	 */
	public WiFiScanReceiver(Nearbyus nearbyus) {
		super();
		this.nearbyus = nearbyus;
		Log.d(TAG, "WifiScanReceiver");
	}

	// TODO - PV Remove this test block upon completion
	public WiFiScanReceiver(WifiLoggingTest wifiLoggingTest) {
		super();
		this.mWifiLoggingTest = wifiLoggingTest;	
		Log.d(TAG, "WifiScanReceiver");
	}

	public WiFiScanReceiver(GPSLoggerService gpsLoggerService) {
		super();
		this.mGPSLoggerTest = gpsLoggerService;
		Log.d(TAG, "WifiScanReceiver");

	}


	/**
	 * @return the results
	 */
	public List<ScanResult> getResults() {
		return results;
	}


	/**
	 * @param results the results to set
	 */
	public void setResults(List<ScanResult> results) {
		this.results = results;
	}


	/* (non-Javadoc)
	 * @see android.content.BroadcastReceiver#onReceive(android.content.Context, android.content.Intent)
	 */
	@Override
	public void onReceive(Context context, Intent intent) {

		Log.d(TAG, "onReceive - WIFIScan");		
		setResults(mGPSLoggerTest.wifi.getScanResults());

	}

}
